package cjm.task5.mapper;


import cjm.task5.pojo.Record;
import cjm.task5.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Optional;

@Mapper
public interface UserMapper {
    List<User> findAll();

    List<User> findAllUser();

    List<User> findAllAdUser();

    User login(@Param("userid")String userid, @Param("password") String password);

    String getPassword(@Param("userid")String userid,@Param("username") String username);

    void updateLock(@Param("id")Integer id,@Param("isLock")Integer isLock);

    User findById(Integer id);

    User findUserByUserid(String userid);

    List<User> findAllAdUserOrder(@Param("orderId")Integer orderId);
    List<User> findAllAdUserOrderByUserId(@Param("orderId")Integer orderId);
    List<User> findAllAdUserOrderByAddress(@Param("orderId")Integer orderId);
    List<User> findAllAdUserOrderByName(@Param("orderId")Integer orderId);


    List<User> findAllUserOrder(@Param("orderId")Integer orderId);
    List<User> findAllUserOrderByUserId(@Param("orderId")Integer orderId);
    List<User> findAllUserOrderByName(@Param("orderId")Integer orderId);
    List<User> findAllUserOrderByAddress(@Param("orderId")Integer orderId);

    List<User> searchAdUser(@Param("keyword")String keyword);

    List<User> searchUser(@Param("keyword")String keyword);

    //获得Spring Security所需的数据
    Optional<User> findUserByName(String userid);

}